<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        
        var x = 10;
        var y = 20;
        xy = add(x, y);
        console.log(xy);
        
        //函数体放在后面也能执行
        function add(a, b){
            console.log(a+b);
            return a+b;
        }
        </script>
</body>
</html>